import request from "@/utils/request";
import exp from "constants";
//王哲 修改代码
/**
 * 商品列表
 */
export function setGoodList() {
  return request({
    url: "/api/goods/productOnlineQueryGet",
    method: "GET",
  });
}

/**
 * 客服电话
 */
export function getPhone() {
  return request({
    url: "/api/index/getHotline",
    method: "GET",
  });
}

/**
 * 商品详情
 */
export function getGoodsDetails(data) {
  return request(
    {
      url: "/api/goods_v2/product_online",
      method: "POST",
      data,
    },
    true
  );
}

/**
 * 商品服务说明
 */
export function getServiceDescription() {
  return request({
    url: "/api/goods/service_description",
    method: "GET",
  });
}

/**
 * 地址列表
 */
export function getAddressList() {
  return request({
    url: "/api/user/address_list",
    method: "GET",
  });
}

/**
 * 住宅面积
 */
export function getResidential() {
  return request({
    url: "/api/user/residential_area",
    method: "GET",
  });
}

/**
 * 保存地址
 */
export function getAddAddress(data) {
  return request(
    {
      url: "/api/user/add_address",
      method: "POST",
      data,
    },
    true
  );
}
/**
 * 删除地址
 */
export function getDelAddress(data) {
  return request(
    {
      url: "/api/user/del_address",
      method: "POST",
      data,
    },
    true
  );
}

/**
 * 获取key
 */
export function getMapKey() {
  return request({
    url: "/api/map/getMapKey",
    method: "POST",
  });
}

/**
 * 提交订单
 */
export function getSubmitOrder(data) {
  return request(
    {
      url: "/api/order/submit_order",
      method: "POST",
      data,
    },
    true
  );
}

/**
 * 订单列表
 */
export function getOrderList(data) {
  return request(
    {
      url: "/api/order/order_list_v2",
      method: "POST",
      data,
    },
    true
  );
}
//api/order/oerder_list_v2
/**
 * 删除订单
 */
export function getOrderDel(data) {
  return request(
    {
      url: "/api/order/order_del",
      method: "POST",
      data,
    },
    true
  );
}

//取消预约
export function cancelMake(data) {
  return request({
    url: "/api/order/userCancelBook",
    method: "GET",
    data,
  });
}

/**
 * 预约订单
 */
export function getReservation(data) {
  return request(
    {
      url: "/api/order/reservation_time",
      method: "POST",
      data,
    },
    true
  );
}

/**
 * 次卡预约订单
 */
export function getckReservation(data) {
  return request(
    {
      url: "/api/order/reservationByTimesCard",
      method: "POST",
      data,
    },
    true
  );
}
/**
 * 修改预约时间
 */
export function modifyReservation(data) {
  return request(
    {
      url: "/api/order/updateReservation",
      method: "POST",
      data,
    },
    true
  );
}

/**
 * 订单详情
 */
export function getOrderDetails(data) {
  return request(
    {
      url: "/api/order/order_detail_v2",
      method: "POST",
      data,
    },
    true
  );
}

/**
 * 订单评价列表
 */
export function getEvaluateList(data) {
  return request(
    {
      url: "/api/order/evaluate_list",
      method: "POST",
      data,
    },
    true
  );
}

/**
 * 订单评价列表
 */
export function getAddEvaluate(data) {
  return request(
    {
      url: "/api/order/add_evaluate",
      method: "POST",
      data,
    },
    true
  );
}

/**
 * 确认订单
 */
export function getOrderConfirm(data) {
  return request(
    {
      url: "/api/order/order_confirm",
      method: "POST",
      data,
    },
    true
  );
}

/**
 * 退款原因列表
 */
export function getRefundReason() {
  return request({
    url: "/api/index_v2/refundReason",
    method: "GET",
  });
}

export function remarksList() {
  return request({
    url: "/api/order_v2/remarks",
    method: "GET",
  });
}

export function selectdays() {
  return request({
    url: "/api/order/days",
    method: "GET",
  });
}
export function selectTime() {
  return request({
    url: "/api/order/selectTime",
    method: "GET",
  });
}
export function selectimes() {
  return request({
    url: "/api/order/times",
    method: "POST",
  });
}
export function distantance(data) {
  return request(
    {
      url: "/api/order/distance",
      method: "POST",
      data,
    },
    true
  );
}
export function position(data) {
  return request(
    {
      url: "/api/order/position",
      method: "POST",
      data,
    },
    true
  );
}
//退款
export function getRefund(data) {
  return request({
    url: "/api/order/refundByTimesCard",
    method: "POST",
    data,
  });
}
//首页
export function getIndex() {
  return request({
    url: "/api/index_v2/index",
    method: "GET",
  });
}
//商品分类
export function getByCat(data) {
  return request({
    url: "/api/index_v2/getProductByCat",
    method: "GET",
    data,
  });
}
//商品分类
export function getGroupId() {
  return request({
    url: "/api/index/getFansGroupId",
    method: "GET",
  });
}
//预约时间
export function testShowTime(data) {
  return request(
    {
      url: "/api/order/selectTime_v2",
      method: "POST",
      data,
    },
    true
  );
}
